﻿using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace BRMC.IntelligentCommunity.Migrations
{
    public partial class _20220111 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //migrationBuilder.AlterColumn<long>(
            //    name: "Orgid",
            //    table: "App_org_rule_relation",
            //    nullable: false,
            //    oldClrType: typeof(int));

            migrationBuilder.CreateTable(
                name: "FaceRecognitions",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Perid = table.Column<string>(nullable: true),
                    Faceid = table.Column<string>(nullable: true),
                    PerName = table.Column<string>(nullable: true),
                    IdcardNum = table.Column<string>(nullable: true),
                    Imgdata = table.Column<string>(nullable: true),
                    Idcardper = table.Column<string>(nullable: true),
                    Stime = table.Column<string>(nullable: true),
                    Etime = table.Column<string>(nullable: true),
                    Pertype = table.Column<int>(nullable: false),
                    Usrtype = table.Column<int>(nullable: false),
                    UserId = table.Column<long>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FaceRecognitions", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "IdentifiedimfInfos",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Perid = table.Column<string>(nullable: true),
                    Faceid = table.Column<string>(nullable: true),
                    PerName = table.Column<string>(nullable: true),
                    IdcardNum = table.Column<string>(nullable: true),
                    Nscore = table.Column<int>(nullable: false),
                    Ipaddr = table.Column<string>(nullable: true),
                    Idcardper = table.Column<string>(nullable: true),
                    ScanTime = table.Column<string>(nullable: true),
                    Temperature = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_IdentifiedimfInfos", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "FaceRecognitions");

            migrationBuilder.DropTable(
                name: "IdentifiedimfInfos");

            //migrationBuilder.AlterColumn<int>(
            //    name: "Orgid",
            //    table: "App_org_rule_relation",
            //    nullable: false,
            //    oldClrType: typeof(long));
        }
    }
}
